package com.wangbo.test.util.model;

import lombok.Data;

@Data
public class CustomException extends RuntimeException {
    private Integer code;
    private String message;
    private BaseEnum exceptionEnum;

    public CustomException(BaseEnum exceptionEnum) {
        this.code = exceptionEnum.getCode();
        this.message = exceptionEnum.getDesc();
        this.exceptionEnum = exceptionEnum;
    }

    public CustomException(int code, String message) {
        this.code = code;
        this.message = message;
    }

}
